from scipy.fft import fft
from scipy.io import wavfile
import pickle

genres_list = ['classical', 'jazz', 'country', 'pop', 'rock', 'metal']

with open('model.pkl', 'rb') as f:
    model = pickle.load(f)

filename = "G:/akaa/test.wav"
samplerate, X = wavfile.read(filename)
test_fft_features = abs(fft(X.reshape(1, -1)[0])[0:1000])
print(test_fft_features, len(test_fft_features))

temp = model.predict([test_fft_features])
print(genres_list[temp[0]])
